package com.zjn.zjngraduationdesign.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zjn.zjngraduationdesign.dao.AdminDao;
import com.zjn.zjngraduationdesign.entity.Admin;
import com.zjn.zjngraduationdesign.entity.User;
import com.zjn.zjngraduationdesign.service.AdminService;
@Service
public class AdminServiceImpl implements AdminService{

	@Autowired
	AdminDao adminDao;
	
	@Override
	public boolean checkLogin(String aname, String apwd) {
		Boolean flag = false;
		Admin admin = adminDao.findAdminByName(aname);
		if(admin != null && admin.getApwd().equals(apwd)) {
			flag = true;			
		}else {
			flag = false;
		}
		return flag;
	}

	@Override
	public List<User> findAllUser() {
		List<User> list = adminDao.findAllUser();
		return list;
	}

}
